Loom
Loom is a testing tool for concurrent Rust code. It runs a test many times, permuting the possible concurrent executions of that test under the [C11 memory model]. It uses [state reduction techniques][cdschecker] to avoid combinatorial explosion.
docs [spec]: https://en.cppreference.com/w/cpp/atomic/memory_order [cdschecker]: http://demsky.eecs.uci.edu/publications/c11modelcheck.pdf
Quickstart
The [loom documentation][docs] has significantly more documentation on
how to use loom. But if you just want a jump-start, first add this to
your Cargo.toml
.
[]
= "0.4"
Next, create a test file and add a test:
use Arc;
use AtomicUsize;
use ;
use thread;
Then, run the test with
RUSTFLAGS="--cfg loom" cargo test --test buggy_concurrent_inc --release
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in loom
by you, shall be licensed as MIT,
without any additional terms or conditions.